Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: consider the cli install directory when resolving plugins #1838

Merged

Conversation

volodymyr-rutskyi
Copy link
Contributor

What/Why/How?

There is an issue when running the npx @redocly/cli preview command when the @redocly/realm package is not installed in the project's node_modules: it's dependent package cannot be resolved.

This happens because the npx installs both the @redocly/realm and it's dependency @redocly/openapi-core into a cache directory (~/.npm/_npx for mac and linux) but when resolving plugins, only the project directory is considered.

This PR adds the package location to the list of directories to resolve the Realm plugins from.

Reference

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Copy link

changeset-bot bot commented Jan 7, 2025

🦋 Changeset detected

Latest commit: 12d1742

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 972.1 ± 15.2 952.6 996.9 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 981.7 ± 16.8 960.7 1017.3 1.01 ± 0.02

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.61% 5046/6419
🟡 Branches 67.24% 2055/3056
🟡 Functions 73.13% 833/1139
🟡 Lines 78.9% 4760/6033

Test suite run success

833 tests passing in 120 suites.

Report generated by 🧪jest coverage report action from 12d1742

@volodymyr-rutskyi volodymyr-rutskyi marked this pull request as ready for review January 7, 2025 12:48
@volodymyr-rutskyi volodymyr-rutskyi requested review from a team as code owners January 7, 2025 12:48
Copy link
Contributor

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave a comment to explain why it was added.

@volodymyr-rutskyi volodymyr-rutskyi merged commit 91c2033 into main Jan 7, 2025
41 checks passed
@volodymyr-rutskyi volodymyr-rutskyi deleted the fix/use-cli-install-dir-for-plugins-resolving branch January 7, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants